home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update18.zoo / gprof / diffs
Encoding:
Text File  |  1992-03-22  |  5.0 KB  |  198 lines

  1. *** 1.6    1992/03/08 17:48:29
  2. --- Changelog    1992/03/23 01:47:27
  3. ***************
  4. *** 46,48 ****
  5. --- 46,53 ----
  6.       link in demangler
  7.   
  8.   ------------------------------- Patchlevel 5 ---------------------------
  9. + gprof.c:: ++jrb
  10. +     various fixes from the net. gprof -s should work better now.
  11. + ------------------------------- Patchlevel 6 ---------------------------
  12. *** 1.7    1992/03/08 17:48:29
  13. --- PatchLev.h    1992/03/23 01:47:27
  14. ***************
  15. *** 1,4 ****
  16. ! #define    PatchLevel "05"
  17.   
  18.   /*
  19.    *    the Patch Level above is to identify the version
  20. --- 1,4 ----
  21. ! #define    PatchLevel "06"
  22.   
  23.   /*
  24.    *    the Patch Level above is to identify the version
  25. *** 1.6    1992/03/08 17:48:29
  26. --- gprof.c    1992/03/23 01:47:29
  27. ***************
  28. *** 73,78 ****
  29. --- 73,82 ----
  30.   #  endif
  31.   #endif
  32.   
  33. + #ifdef HAVE_SETITIMER
  34. + #include <sys/time.h>
  35. + #endif
  36.   #include "gmon.h"
  37.   /* #include <nlist.h> */
  38.   
  39. ***************
  40. *** 772,777 ****
  41. --- 776,787 ----
  42.        
  43.     char *name = '\0';
  44.     int    ind;  
  45. + #ifndef atarist
  46. +   long int syms_offset;
  47. +   unsigned int syms_size;
  48. +   long int strs_offset;
  49. +   unsigned int strs_size;
  50. + #endif
  51.   
  52.   #ifdef atarist
  53.     _malloczero(1);
  54. ***************
  55. *** 1082,1089 ****
  56.          were called from, we fake it.  Since this is only
  57.          gonna be fed back into gprof, it doesn't matter */
  58.   #ifndef atarist
  59. !     call_tmp.from=(p->value+FUDGE_FACTOR)-hdr.low;
  60. !     call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)-hdr.low;
  61.   #else
  62.       call_tmp.from=(p->value+FUDGE_FACTOR)+hdr.low;
  63.       call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)+hdr.low;
  64. --- 1092,1101 ----
  65.          were called from, we fake it.  Since this is only
  66.          gonna be fed back into gprof, it doesn't matter */
  67.   #ifndef atarist
  68. !       call_tmp.from=p->value+FUDGE_FACTOR;
  69. !       call_tmp.to=t->sym_to->value+FUDGE_FACTOR;
  70. ! /*    call_tmp.from=(p->value+FUDGE_FACTOR)-hdr.low;
  71. !     call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)-hdr.low; */
  72.   #else
  73.       call_tmp.from=(p->value+FUDGE_FACTOR)+hdr.low;
  74.       call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)+hdr.low;
  75. ***************
  76. *** 2134,2140 ****
  77.   }
  78.   #endif /* atarist */
  79.   
  80. ! /* Return the symbol which has the largest value less than VAL.
  81.      Since the symbol vector is sorted by value, this is done
  82.      with a binary search.  */
  83.   
  84. --- 2146,2152 ----
  85.   }
  86.   #endif /* atarist */
  87.   
  88. ! /* Return the symbol which has the largest value less than or equal to VAL.
  89.      Since the symbol vector is sorted by value, this is done
  90.      with a binary search.  */
  91.   
  92. ***************
  93. *** 2149,2155 ****
  94.       if (m->value>val) {
  95.         m-=gap;
  96.         gap/=2;
  97. !     } else if ((m+1)->value<val) {
  98.         m+=gap;
  99.         gap/=2;
  100.       } else
  101. --- 2161,2168 ----
  102.       if (m->value>val) {
  103.         m-=gap;
  104.         gap/=2;
  105. !     } else if ((m+1)->value<=val) { /* *********** TEST ********* */
  106. ! /*     } else if ((m+1)->value<val) { */
  107.         m+=gap;
  108.         gap/=2;
  109.       } else
  110. ***************
  111. *** 2169,2174 ****
  112. --- 2182,2188 ----
  113.   int
  114.   badsym FUN1(struct nlist *, sym)
  115.   {
  116. +   int local;
  117.   #ifndef N_SECT
  118.     if ((sym->n_type & ~N_EXT) != N_TEXT)
  119.       return TRUE;
  120. ***************
  121. *** 2176,2185 ****
  122.     if ((sym->n_type & ~N_EXT) != N_TEXT && (sym->n_type & ~N_EXT) != N_SECT)
  123.       return TRUE;
  124.   #endif
  125. !   if (no_locals && !(sym->n_type&N_EXT))
  126.       return TRUE;
  127.     /* Filenames or pascal labels should be ignored */
  128. !   if (index (sym->n_un.n_name, '.') || index (sym->n_un.n_name, '$'))
  129.       return TRUE;
  130.     return FALSE;
  131.   }
  132. --- 2190,2206 ----
  133.     if ((sym->n_type & ~N_EXT) != N_TEXT && (sym->n_type & ~N_EXT) != N_SECT)
  134.       return TRUE;
  135.   #endif
  136. !   local = !(sym->n_type&N_EXT);
  137. !   if (no_locals && !local)
  138.       return TRUE;
  139.     /* Filenames or pascal labels should be ignored */
  140. ! if (local
  141. !     && (index (sym->n_un.n_name, '.')
  142. !       || index (sym->n_un.n_name, '$')
  143. ! #ifndef nounderscore
  144. !       || sym->n_un.n_name[0] != '_'
  145. ! #endif
  146. !       ))
  147.       return TRUE;
  148.     return FALSE;
  149.   }
  150. ***************
  151. *** 2410,2415 ****
  152. --- 2431,2455 ----
  153.       fputs (blurb, stdout);
  154.   }
  155.   
  156. + #ifdef HAVE_SETITIMER
  157. + get_ticks()
  158. + {
  159. +   struct itimerval tim;
  160. +   
  161. +   tim.it_interval.tv_sec = 0;
  162. +   tim.it_interval.tv_usec = 1;
  163. +   timerclear(&tim.it_value);
  164. +   if (setitimer(ITIMER_REAL, &tim, 0) < 0
  165. +       || setitimer(ITIMER_REAL, 0, &tim) < 0) {
  166. +     fprintf(stderr, "%s: setitimer: ", myname);
  167. +     perror((char *)0);
  168. +     exit(1);
  169. +   }
  170. +   return 1000000/tim.it_interval.tv_usec;
  171. + }
  172. + #else /* not HAVE_SETITIMER */
  173.   
  174.   /* Find the number of clock ticks/second by reading the kernel's memory.
  175.      This means that if /dev/kmem isn't readable, this program will have to run
  176. ***************
  177. *** 2446,2452 ****
  178.     PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_MISC, ("get_ticks ()=%ld", ret));
  179.     return ret;
  180.   }
  181.   
  182.   /* Record one -e, -E, -f or -F option in `filters', and check for conflicts.
  183.      All these options are recorded there for processing later
  184. --- 2486,2492 ----
  185.     PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_MISC, ("get_ticks ()=%ld", ret));
  186.     return ret;
  187.   }
  188. ! #endif /* not HAVE_SETITIMER */
  189.   
  190.   /* Record one -e, -E, -f or -F option in `filters', and check for conflicts.
  191.      All these options are recorded there for processing later
  192.